#!/bin/sh
#
# Copyright (C) 2008 DeonWu@gmail.com
#
# This file is part of Js-Shell. Js-Shell is a set of library for running
# javascript in Rhino.
#
# Js-Shell is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Js-Shell is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Js-Shell.  If not, see <http://www.gnu.org/licenses/>.
#
# $ Name LastChangeRevision LastChangeDate LastChangeBy $
# $Id: js 65 2008-08-28 09:40:38Z DeonWu $
#

echo `dirname "$0"`
# OS specific support.  
JS_HOME=`dirname "$0"`
JS_HOME=`dirname "$JS_HOME"`
cygwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
	JS_HOME=`cygpath --windows "$JS_HOME"`
fi

java -classpath "$JS_HOME/bin" -DJS_HOME=$JS_HOME JavaScript $@